#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int SearchOnlyFirst(string& s1)
{
	int count[26] = { 0 };

	for (auto ch : s1)
	{
		count[ch - 'a']++;
	}

	for (size_t i = 0; i < s1.size(); i++)
	{
		if (count[s1[i] - 'a'] == 1)
		{
			return i;
		}
	}
	return -1;

}

int main()
{
	string s("otdeetcode");
	int ret=SearchOnlyFirst(s);

	cout << ret;
	return 0;
}